 
 CREATE TABLE clsElementType (
        idElement            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NOT NULL
 )
go
 
 
 ALTER TABLE clsElementType
        ADD PRIMARY KEY (idElement)
go
 
 
 CREATE TABLE queryGroupList (
        idQuery              numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE queryGroupList
        ADD PRIMARY KEY (idQuery)
go
 
 
 CREATE TABLE clsFlagTrueFalse (
        clsFlag              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE clsFlagTrueFalse
        ADD PRIMARY KEY (clsFlag)
go
 
 
 CREATE TABLE EditInterface (
        idPointer            numeric(10,0) NOT NULL,
        idMainPointer        numeric(10,0) NULL,
        idElement            numeric(10,0) NULL,
        textDefinition       nvarchar(250) NULL,
        fieldName            nvarchar(40) NULL,
        fieldLenght          numeric(10,0) NULL,
        fieldLinesCount      numeric(10,0) NULL,
        clsFlagTrue          numeric(10,0) NULL,
        clsFlagFalse         numeric(10,0) NULL,
        queryGroup           numeric(10,0) NULL,
        queryList            numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE EditInterface
        ADD PRIMARY KEY (idPointer)
go
 
 
 CREATE TABLE idTable (
        idTable              numeric(10,0) NOT NULL,
        idText               nvarchar(150) NULL,
        genidBase            numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE idTable
        ADD PRIMARY KEY (idTable)
go
 
 
 CREATE TABLE clsParameter (
        idParameter          numeric(10,0) NOT NULL,
        tableName            nvarchar(40) NULL,
        hasGrid              numeric(1,0) NULL,
        idTable              numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE clsParameter
        ADD PRIMARY KEY (idParameter)
go
 
 
 CREATE TABLE Hierarchy (
        idItem               numeric(10,0) NOT NULL,
        idInterfacePointer   numeric(10,0) NULL,
        idMainItem           numeric(10,0) NULL,
        textDefinition       nvarchar(250) NULL,
        idParameter          numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Hierarchy
        ADD PRIMARY KEY (idItem)
go
 
 
 CREATE TABLE clsQuery (
        idQuery              numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NOT NULL
 )
go
 
 
 ALTER TABLE clsQuery
        ADD PRIMARY KEY (idQuery)
go
 
 
 CREATE TABLE ViewModeParameters (
        idFeature            numeric(10,0) NOT NULL,
        idInterfacePointer   numeric(10,0) NULL,
        textDefinition       nvarchar(250) NULL,
        pointer              numeric(10,0) NULL,
        idQuery              numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE ViewModeParameters
        ADD PRIMARY KEY (idFeature)
go
 
 
 CREATE TABLE Triggers (
        idTrigger            numeric(10,0) NOT NULL,
        triggerName          nvarchar(150) NULL,
        Ord                  numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Triggers
        ADD PRIMARY KEY (idTrigger)
go
 
 
 CREATE TABLE PDASelectQuery (
        idQueryPDAS          numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE PDASelectQuery
        ADD PRIMARY KEY (idQueryPDAS)
go
 
 
 CREATE TABLE InsertQuery (
        idQueryI             numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE InsertQuery
        ADD PRIMARY KEY (idQueryI)
go
 
 
 CREATE TABLE DelQuery (
        iqQueryD             numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE DelQuery
        ADD PRIMARY KEY (iqQueryD)
go
 
 
 CREATE TABLE TransferTemp (
        idTransferTemp       numeric(10,0) NOT NULL,
        idQueryPDAS          numeric(10,0) NULL,
        iqQueryD             numeric(10,0) NULL,
        Ord                  numeric(10,0) NULL,
        queryTempToClient    numeric(10,0) NULL,
        nameTempTable        nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE TransferTemp
        ADD PRIMARY KEY (idTransferTemp)
go
 
 
 CREATE TABLE SelectQuery (
        iqQueryS             numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE SelectQuery
        ADD PRIMARY KEY (iqQueryS)
go
 
 
 CREATE TABLE ClearQuery (
        idQueryC             numeric(10,0) NOT NULL,
        queryText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE ClearQuery
        ADD PRIMARY KEY (idQueryC)
go
 
 
 CREATE TABLE Transfer (
        idNum                numeric(10,0) NOT NULL,
        idTransferTemp       numeric(10,0) NULL,
        idQueryC             numeric(10,0) NULL,
        iqQueryS             numeric(10,0) NULL,
        Ord                  numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Transfer
        ADD PRIMARY KEY (idNum)
go
 
 
 CREATE TABLE UsIndBm (
        idGU                 numeric(10,0) NOT NULL,
        idOrg                numeric(10,0) NULL,
        idBrOrg              numeric(10,0) NULL,
        idBr                 numeric(10,0) NULL,
        idBrOvRd             numeric(10,0) NULL,
        idBrOver             numeric(10,0) NULL,
        idBrOverRw           numeric(10,0) NULL,
        idBrRiver            numeric(10,0) NULL,
        idBrDam              numeric(10,0) NULL,
        idBrPier             numeric(10,0) NULL,
        idBrBear             numeric(10,0) NULL,
        idBrCom              numeric(10,0) NULL,
        idBrSign             numeric(10,0) NULL,
        idBrCrash            numeric(10,0) NULL,
        idBrDoc              numeric(10,0) NULL,
        idBrDef              numeric(10,0) NULL,
        idBrElm              numeric(10,0) NULL,
        idDefKind            numeric(10,0) NULL,
        idDefView            numeric(10,0) NULL,
        idDefElm             numeric(10,0) NULL,
        elmCode              numeric(10,0) NULL,
        defCode              numeric(10,0) NULL,
        idView               numeric(10,0) NULL,
        idBrBeam             numeric(10,0) NULL,
        idTar                numeric(10,0) NULL,
        idRate               numeric(10,0) NULL,
        idRtTar              numeric(10,0) NULL,
        idRtDE               numeric(10,0) NULL,
        idDue                numeric(10,0) NULL,
        idCstInd             numeric(10,0) NULL,
        idAccRep             numeric(10,0) NULL,
        idTaxRt              numeric(10,0) NULL,
        idTKTSTyp            numeric(10,0) NULL,
        idAxDist             numeric(10,0) NULL,
        idAxLoad             numeric(10,0) NULL,
        idCalcTyp            numeric(10,0) NULL,
        idLoadingPoint       numeric(10,0) NULL,
        idSubPoint           numeric(10,0) NULL,
        idBrPSpan            numeric(10,0) NULL,
        idPSpanCalcView      numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE UsIndBm
        ADD PRIMARY KEY (idGU)
go
 
 
 CREATE TABLE Org (
        idOrg                numeric(10,0) NOT NULL,
        idUpr                numeric(10,0) NULL,
        orgName              nvarchar(150) NULL,
        kUpr                 numeric(10,0) NULL,
        kOrg                 numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Org
        ADD PRIMARY KEY (idOrg)
go
 
 
 CREATE TABLE BrOrg (
        idBrOrg              numeric(10,0) NOT NULL,
        idMaster             numeric(10,0) NULL,
        idOrg                numeric(10,0) NOT NULL
 )
go
 
 
 ALTER TABLE BrOrg
        ADD PRIMARY KEY (idBrOrg)
go
 
 
 CREATE TABLE UsAccBm (
        idGU                 numeric(10,0) NOT NULL,
        begUID               numeric(10,0) NULL,
        enterText            nvarchar(250) NULL,
        begTime              datetime NULL,
        endTime              datetime NULL,
        timeLimit            datetime NULL,
        expDate              datetime NULL,
        impDate              datetime NULL,
        ucExpDate            datetime NULL,
        ucLmpDate            datetime NULL,
        oldDate              datetime NULL,
        oldText              nvarchar(250) NULL,
        accRd                numeric(1,0) NULL,
        accWt                numeric(1,0) NULL,
        idBrOrgRd            numeric(10,0) NULL,
        idBrOrgWt            numeric(10,0) NULL,
        accClsEd             numeric(1,0) NULL,
        accClsDel            numeric(1,0) NULL,
        accDefEd             numeric(1,0) NULL,
        accDefDel            numeric(1,0) NULL,
        accCstEd             numeric(1,0) NULL,
        accOrgIns            numeric(1,0) NULL,
        accOrgDel            numeric(1,0) NULL,
        accOrgMas            numeric(1,0) NULL,
        accOrgOrg            numeric(1,0) NULL,
        accBrIns             numeric(1,0) NULL,
        accBrDel             numeric(1,0) NULL,
        accBrOrg             numeric(1,0) NULL,
        accBrNam             numeric(1,0) NULL,
        accBrEdit            numeric(1,0) NULL,
        accExp               numeric(1,0) NULL,
        accImp               numeric(1,0) NULL,
        acctoAdm             numeric(1,0) NULL,
        accTKTSEd            numeric(1,0) NULL,
        accTKTSCalc          numeric(1,0) NULL,
        accPsSpan            numeric(1,0) NULL,
        accActLoad           numeric(1,0) NULL,
        accCalcGrd           numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE UsAccBm
        ADD PRIMARY KEY (idGU)
go
 
 
 CREATE TABLE UserBm (
        idGU                 numeric(10,0) NOT NULL,
        enterGU              nvarchar(40) NULL,
        nameGU               nvarchar(40) NULL,
        descrGU              nvarchar(250) NULL,
        enterDate            datetime NULL,
        expDate              datetime NULL,
        impDate              datetime NULL,
        offGU                numeric(1,0) NULL,
        offText              nvarchar(250) NULL,
        toAdmin              nvarchar(250) NULL,
        toUser               nvarchar(250) NULL,
        clearUser            numeric(1,0) NULL,
        superUser            numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE UserBm
        ADD PRIMARY KEY (idGU)
go
 
 
 CREATE TABLE RepBm (
        idRep                numeric(10,0) NOT NULL,
        repName              nvarchar(50) NULL
 )
go
 
 
 ALTER TABLE RepBm
        ADD PRIMARY KEY (idRep)
go
 
 
 CREATE TABLE ClsBeam (
        clsBeam              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBeam
        ADD PRIMARY KEY (clsBeam)
go
 
 
 CREATE TABLE ClsBmUn (
        clsBmUn              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBmUn
        ADD PRIMARY KEY (clsBmUn)
go
 
 
 CREATE TABLE ClsMat (
        clsMat               numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsMat
        ADD PRIMARY KEY (clsMat)
go
 
 
 CREATE TABLE Reg (
        idReg                numeric(10,0) NOT NULL,
        idRegMVD             numeric(10,0) NULL,
        regNm                nvarchar(30) NULL,
        regName              nvarchar(30) NULL,
        regGNm               nvarchar(30) NULL,
        regGName             nvarchar(30) NULL
 )
go
 
 CREATE UNIQUE INDEX XAK1Reg ON Reg
 (
        idRegMVD
 )
go
 
 
 ALTER TABLE Reg
        ADD PRIMARY KEY (idReg)
go
 
 
 CREATE TABLE Dis (
        idDis                numeric(10,0) NOT NULL,
        idDisMVD             numeric(10,0) NULL,
        idReg                numeric(10,0) NOT NULL,
        disNm                nvarchar(30) NULL,
        disName              nvarchar(30) NULL,
        disGNm               nvarchar(30) NULL,
        disGName             nvarchar(30) NULL
 )
go
 
 CREATE UNIQUE INDEX XAK1Dis ON Dis
 (
        idDisMVD
 )
go
 
 
 ALTER TABLE Dis
        ADD PRIMARY KEY (idDis)
go
 
 
 CREATE TABLE Br (
        idBr                 numeric(10,0) NOT NULL,
        brName               nvarchar(100) NULL,
        idBrOrg              numeric(10,0) NULL,
        idReg                numeric(10,0) NULL,
        idDis                numeric(10,0) NULL,
        idOwnOrg             numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Br
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE BrBeam (
        idBr                 numeric(10,0) NOT NULL,
        idBrBeam             numeric(10,0) NOT NULL,
        spanBeg              numeric(10,0) NULL,
        spanEnd              numeric(10,0) NULL,
        beamBeg              numeric(10,0) NULL,
        beamEnd              numeric(10,0) NULL,
        numBmJack            numeric(10,0) NULL,
        clsBeam              numeric(10,0) NULL,
        numBmSupl            numeric(10,0) NULL,
        clsMat               numeric(10,0) NULL,
        bmLength             numeric(5,2) NULL,
        bmHeight             numeric(5,2) NULL,
        bmWidth              numeric(5,2) NULL,
        bmStep               numeric(5,2) NULL,
        thickMonSpan         numeric(5,2) NULL,
        clsBmUn1             numeric(10,0) NULL,
        numDiaph             numeric(10,0) NULL,
        clsBmUn2             numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL,
        stdDesign            nvarchar(40) NULL
 )
go
 
 
 ALTER TABLE BrBeam
        ADD PRIMARY KEY (idBrBeam, idBr)
go
 
 
 CREATE TABLE ElmBM (
        elmCode              numeric(10,0) NOT NULL,
        elmName              nvarchar(50) NULL,
        ownElm               numeric(10,0) NULL,
        elmMName             nvarchar(50) NULL,
        clsName              nvarchar(10) NULL,
        elmNm                nvarchar(20) NULL,
        elmState             nvarchar(50) NULL,
        perlNum              nvarchar(50) NULL,
        perlEach             nvarchar(50) NULL,
        elmNPP               nvarchar(10) NULL,
        canDef               numeric(1,0) NULL,
        canUser              numeric(1,0) NULL,
        canTotal             numeric(1,0) NULL,
        canRep               numeric(1,0) NULL,
        canState             numeric(1,0) NULL,
        canList              numeric(1,0) NULL,
        canCap               numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE ElmBM
        ADD PRIMARY KEY (elmCode)
go
 
 
 CREATE TABLE ClsDefUn (
        clsDefUn             numeric(10,0) NOT NULL,
        clsText              nvarchar(50) NULL,
        clsShort             nvarchar(10) NULL
 )
go
 
 
 ALTER TABLE ClsDefUn
        ADD PRIMARY KEY (clsDefUn)
go
 
 
 CREATE TABLE DefKindBM (
        idDefKind            numeric(10,0) NOT NULL,
        defNPP               nvarchar(10) NULL,
        defName              nvarchar(250) NULL,
        defNm                nvarchar(100) NULL,
        clsDefUn             numeric(10,0) NULL
 )
go
 
 CREATE UNIQUE INDEX XAK1DefKindBM ON DefKindBM
 (
        defNPP
 )
go
 
 
 ALTER TABLE DefKindBM
        ADD PRIMARY KEY (idDefKind)
go
 
 
 CREATE TABLE DefBM (
        defCode              numeric(10,0) NOT NULL,
        rootDef              numeric(10,0) NULL,
        idDefKind            numeric(10,0) NOT NULL,
        valR                 numeric(5,2) NULL,
        isRadio              numeric(1,0) NULL,
        isDefault            numeric(1,0) NULL,
        valW                 numeric(5,2) NULL,
        valRW                numeric(5,2) NULL,
        impCap               numeric(1,0) NULL,
        perlIns              nvarchar(50) NULL,
        impSup               numeric(1,0) NULL,
        impSaf               numeric(1,0) NULL,
        defCat               numeric(10,0) NULL,
        idRep                numeric(10,0) NULL,
        numPriority          numeric(10,0) NULL,
        addSign              numeric(10,0) NULL,
        addVal               nvarchar(50) NULL
 )
go
 
 
 ALTER TABLE DefBM
        ADD PRIMARY KEY (defCode)
go
 
 
 CREATE TABLE DefElmBM (
        idDefElm             numeric(10,0) NOT NULL,
        defCode              numeric(10,0) NOT NULL,
        elmCode              numeric(10,0) NOT NULL,
        elmClass             numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE DefElmBM
        ADD PRIMARY KEY (idDefElm)
go
 
 
 CREATE TABLE Rd (
        idRd                 numeric(10,0) NOT NULL,
        rdName               nvarchar(100) NULL,
        rdNum                nvarchar(10) NULL,
        rdWay                numeric(10,0) NULL,
        rdRight              numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE Rd
        ADD PRIMARY KEY (idRd)
go
 
 
 CREATE TABLE ClsBrDE (
        clsBrDE              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrDE
        ADD PRIMARY KEY (clsBrDE)
go
 
 
 CREATE TABLE ClsBrDev (
        clsBrDev             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrDev
        ADD PRIMARY KEY (clsBrDev)
go
 
 
 CREATE TABLE ClsBrBld (
        clsBrBld             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrBld
        ADD PRIMARY KEY (clsBrBld)
go
 
 
 CREATE TABLE ClsBrReg (
        clsBrReg             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrReg
        ADD PRIMARY KEY (clsBrReg)
go
 
 
 CREATE TABLE ClsBrRun (
        clsBrRun             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrRun
        ADD PRIMARY KEY (clsBrRun)
go
 
 
 CREATE TABLE ClsBrSt (
        clsBrSt              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrSt
        ADD PRIMARY KEY (clsBrSt)
go
 
 
 CREATE TABLE ClsBrMat (
        clsBrMat             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrMat
        ADD PRIMARY KEY (clsBrMat)
go
 
 
 CREATE TABLE ClsBrTyp (
        clsBrTyp             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrTyp
        ADD PRIMARY KEY (clsBrTyp)
go
 
 
 CREATE TABLE ClsBrLoc (
        clsBrLoc             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrLoc
        ADD PRIMARY KEY (clsBrLoc)
go
 
 
 CREATE TABLE ClsBrPos (
        clsBrPos             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBrPos
        ADD PRIMARY KEY (clsBrPos)
go
 
 
 CREATE TABLE BrGen (
        idBr                 numeric(10,0) NOT NULL,
        rdAccLane            numeric(2,0) NULL,
        idRd                 numeric(10,0) NULL,
        brKm                 numeric(8,3) NULL,
        rdCat                nchar(2) NULL,
        rdLane               numeric(2,0) NULL,
        brDir                numeric(2,0) NULL,
        rdRelAccLane         numeric(2,0) NULL,
        idRelRd              numeric(10,0) NULL,
        brLen                numeric(8,3) NULL,
        brRelKm              numeric(8,3) NULL,
        rdRelCat             nchar(2) NULL,
        brNum                numeric(10,0) NULL,
        clsBrPos             numeric(10,0) NULL,
        rdRelLane            numeric(2,0) NULL,
        clsBrLoc             numeric(10,0) NULL,
        clsBrTyp             numeric(10,0) NULL,
        clsBrMat             numeric(10,0) NULL,
        tnName               nvarchar(30) NULL,
        tnDist               numeric(8,3) NULL,
        brFwayL              numeric(5,2) NULL,
        brRwayL              numeric(5,2) NULL,
        brStrip              numeric(5,2) NULL,
        brRwayR              numeric(5,2) NULL,
        brFwayR              numeric(5,2) NULL,
        brFullBC             numeric(5,2) NULL,
        brFullOk             numeric(1,0) NULL,
        brRIWidth            numeric(5,2) NULL,
        brDimen              nvarchar(60) NULL,
        brSchem              nvarchar(60) NULL,
        brOblAng             numeric(4,1) NULL,
        limVDim              numeric(1,0) NULL,
        brVDim               numeric(5,2) NULL,
        brUDim               numeric(5,2) NULL,
        brArea               numeric(8,3) NULL,
        clsBrSt1             numeric(10,0) NULL,
        clsBrSt2             numeric(10,0) NULL,
        clsBrRun             numeric(10,0) NULL,
        brLight              numeric(1,0) NULL,
        brDesLoad            nvarchar(20) NULL,
        clsBrReg             numeric(10,0) NULL,
        brRegAdv             nvarchar(100) NULL,
        brOffAdv             nvarchar(100) NULL,
        brBYear              numeric(4,0) NULL,
        clsBrBld             numeric(10,0) NULL,
        clsBrDev             numeric(10,0) NULL,
        clsBrDE              numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrGen
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE ClsMOrg (
        clsMOrg              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsMOrg
        ADD PRIMARY KEY (clsMOrg)
go
 
 
 CREATE TABLE ClsMArg (
        clsMArg              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsMArg
        ADD PRIMARY KEY (clsMArg)
go
 
 
 CREATE TABLE BrLimit (
        idBr                 numeric(10,0) NOT NULL,
        limMass              numeric(5,2) NULL,
        limLoad              numeric(5,2) NULL,
        clsMOrg              numeric(10,0) NULL,
        limHeight            numeric(5,2) NULL,
        limWidth             numeric(5,2) NULL,
        limDist              numeric(4,0) NULL,
        limSpeed             numeric(4,0) NULL,
        clsMArg              numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrLimit
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE ClsTstRec (
        clsTstRec            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsTstRec
        ADD PRIMARY KEY (clsTstRec)
go
 
 
 CREATE TABLE ClsTstOrg (
        clsTstOrg            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsTstOrg
        ADD PRIMARY KEY (clsTstOrg)
go
 
 
 CREATE TABLE BrVisit (
        idBr                 numeric(10,0) NOT NULL,
        clsVisR1             numeric(10,0) NULL,
        visDate              datetime NULL,
        who_edit             nvarchar(20) NULL,
        clsVisOrg            numeric(10,0) NULL,
        clsVisR2             numeric(10,0) NULL,
        clsVisR3             numeric(10,0) NULL
 )
go
 
 
 ALTER TABLE BrVisit
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE ClsPrCov (
        clsPrCov             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsPrCov
        ADD PRIMARY KEY (clsPrCov)
go
 
 
 CREATE TABLE ClsDrain (
        clsDrain             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsDrain
        ADD PRIMARY KEY (clsDrain)
go
 
 
 CREATE TABLE ClsBord (
        clsBord              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBord
        ADD PRIMARY KEY (clsBord)
go
 
 
 CREATE TABLE ClsCov (
        clsCov               numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsCov
        ADD PRIMARY KEY (clsCov)
go
 
 
 CREATE TABLE ClsFway (
        clsFway              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsFway
        ADD PRIMARY KEY (clsFway)
go
 
 
 CREATE TABLE ClsRail (
        clsRail              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsRail
        ADD PRIMARY KEY (clsRail)
go
 
 
 CREATE TABLE ClsPosJt (
        clsPosJt             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsPosJt
        ADD PRIMARY KEY (clsPosJt)
go
 
 
 CREATE TABLE ClsCtrlJt (
        clsCtrlJt            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsCtrlJt
        ADD PRIMARY KEY (clsCtrlJt)
go
 
 
 CREATE TABLE ClsHydMat (
        clsHydMat            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsHydMat
        ADD PRIMARY KEY (clsHydMat)
go
 
 
 CREATE TABLE ClsHydTyp (
        clsHydTyp            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsHydTyp
        ADD PRIMARY KEY (clsHydTyp)
go
 
 
 CREATE TABLE ClsCLMeth (
        clsCLMeth            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsCLMeth
        ADD PRIMARY KEY (clsCLMeth)
go
 
 
 CREATE TABLE BrDeck (
        idBr                 numeric(10,0) NOT NULL,
        clsDCovUp            numeric(10,0) NULL,
        thDCovUp             numeric(4,1) NULL,
        clsDCovDn            numeric(10,0) NULL,
        thDCovDn             numeric(4,1) NULL,
        clsPlCov             numeric(10,0) NULL,
        safStrip             numeric(1,0) NULL,
        clsPrCov             numeric(10,0) NULL,
        thPlCov              numeric(4,1) NULL,
        thAvCov              numeric(4,1) NULL,
        thPrCov              numeric(4,1) NULL,
        deckIL               numeric(2,0) NULL,
        deckCL               numeric(2,0) NULL,
        clsDeckCL            numeric(10,0) NULL,
        fwayCL               numeric(2,0) NULL,
        clsFwayCL            numeric(10,0) NULL,
        clsHydTyp            numeric(10,0) NULL,
        clsHydMat            numeric(10,0) NULL,
        thHyd                numeric(4,1) NULL,
        clsCtrlJt            numeric(10,0) NULL,
        clsPosJt             numeric(10,0) NULL,
        clsRail              numeric(10,0) NULL,
        rlHeight             numeric(5,2) NULL,
        rlHOk                numeric(1,0) NULL,
        rlStdDes             nvarchar(40) NULL,
        clsFway              numeric(10,0) NULL,
        clsFWCov             numeric(10,0) NULL,
        thFWCov              numeric(4,1) NULL,
        fwStdDes             nvarchar(40) NULL,
        clsBord              numeric(10,0) NULL,
        bdHeight             numeric(5,2) NULL,
        bdWidth              numeric(5,2) NULL,
        bdHOk                numeric(1,0) NULL,
        Notes                nvarchar(1000) NULL,
        numCheek             numeric(10,0) NULL,
        bdStrip              numeric(1,0) NULL,
        clsDrain             numeric(10,0) NULL,
        numDPipe             numeric(10,0) NULL,
        ltEven               numeric(8,3) NULL,
        rtEven               numeric(8,3) NULL
 )
go
 
 
 ALTER TABLE BrDeck
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE ClsOvrTyp (
        clsOvrTyp            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsOvrTyp
        ADD PRIMARY KEY (clsOvrTyp)
go
 
 
 CREATE TABLE BrOver (
        idBr                 numeric(10,0) NOT NULL,
        idBrOver             numeric(10,0) NOT NULL,
        clsOvrTyp            numeric(10,0) NULL,
        ovrName              nvarchar(40) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrOver
        ADD PRIMARY KEY (idBrOver, idBr)
go
 
 
 CREATE TABLE ClsStPos (
        clsStPos             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsStPos
        ADD PRIMARY KEY (clsStPos)
go
 
 
 CREATE TABLE ClsCone (
        clsCone              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsCone
        ADD PRIMARY KEY (clsCone)
go
 
 
 CREATE TABLE ClsMating (
        clsMating            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsMating
        ADD PRIMARY KEY (clsMating)
go
 
 
 CREATE TABLE BrAppr (
        idBr                 numeric(10,0) NOT NULL,
        mdHeightB            numeric(5,2) NULL,
        mdHeightE            numeric(5,2) NULL,
        mdPosB               nvarchar(30) NULL,
        mdPosE               nvarchar(30) NULL,
        mdSlantB             numeric(5,2) NULL,
        mdSlantE             numeric(5,2) NULL,
        solSlantB            numeric(10,0) NULL,
        solSlantE            numeric(10,0) NULL,
        clsMatB              numeric(10,0) NULL,
        lwWidthB             numeric(5,2) NULL,
        mtStdDesB            nvarchar(40) NULL,
        clsMatE              numeric(10,0) NULL,
        lwWidthE             numeric(5,2) NULL,
        clsDckB              numeric(10,0) NULL,
        mtStdDesE            nvarchar(40) NULL,
        dckWidthB            numeric(5,2) NULL,
        dckWidthE            numeric(5,2) NULL,
        clsDckE              numeric(10,0) NULL,
        incLineB             numeric(2,0) NULL,
        incLineE             numeric(2,0) NULL,
        crsLineB             numeric(2,0) NULL,
        crsLineE             numeric(2,0) NULL,
        clsBordB             numeric(10,0) NULL,
        bdHeightB            numeric(5,2) NULL,
        bdLengthB            numeric(5,2) NULL,
        bdRangeB             numeric(1,0) NULL,
        clsBordE             numeric(10,0) NULL,
        bdHeightE            numeric(5,2) NULL,
        bdLengthE            numeric(5,2) NULL,
        bdRangeE             numeric(1,0) NULL,
        clsDrainB            numeric(10,0) NULL,
        clsDrainE            numeric(10,0) NULL,
        cnSlantB             numeric(5,2) NULL,
        cnSlantE             numeric(5,2) NULL,
        clsConeB             numeric(10,0) NULL,
        clsConeE             numeric(10,0) NULL,
        cnSupB               numeric(1,0) NULL,
        cnSupE               numeric(1,0) NULL,
        clsStPosB            numeric(10,0) NULL,
        clsStPosE            numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrAppr
        ADD PRIMARY KEY (idBr)
go
 
 
 CREATE TABLE ClsOvRd (
        clsOvRd              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsOvRd
        ADD PRIMARY KEY (clsOvRd)
go
 
 
 CREATE TABLE BrOvRd (
        idBr                 numeric(10,0) NOT NULL,
        idBrOvRd             numeric(10,0) NOT NULL,
        clsOvRd              numeric(10,0) NULL,
        idOvRd               numeric(10,0) NULL,
        ovRdCat              nchar(2) NULL,
        ovRdKm               numeric(8,3) NULL,
        ovRdLane             numeric(10,0) NULL,
        ovRdVert             numeric(5,2) NULL,
        ovRdWidth            numeric(5,2) NULL,
        ovRdAng              numeric(4,1) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrOvRd
        ADD PRIMARY KEY (idBrOvRd, idBr)
go
 
 
 CREATE TABLE ClsOvRw (
        clsOvRw              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsOvRw
        ADD PRIMARY KEY (clsOvRw)
go
 
 
 CREATE TABLE BrOvRw (
        idBr                 numeric(10,0) NOT NULL,
        idBrOvRw             numeric(10,0) NOT NULL,
        clsOvRw              numeric(10,0) NULL,
        rwName               nvarchar(60) NULL,
        ovRwTrack            numeric(10,0) NULL,
        ovRwVert             numeric(5,2) NULL,
        ovRwEl               numeric(1,0) NULL,
        ovRwStat             numeric(1,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrOvRw
        ADD PRIMARY KEY (idBrOvRw, idBr)
go
 
 
 CREATE TABLE ClsSlope (
        clsSlope             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsSlope
        ADD PRIMARY KEY (clsSlope)
go
 
 
 CREATE TABLE ClsSlBase (
        clsSlBase            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsSlBase
        ADD PRIMARY KEY (clsSlBase)
go
 
 
 CREATE TABLE ClsDamTyp (
        clsDamTyp            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsDamTyp
        ADD PRIMARY KEY (clsDamTyp)
go
 
 
 CREATE TABLE ClsDam (
        clsDam               numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsDam
        ADD PRIMARY KEY (clsDam)
go
 
 
 CREATE TABLE BrDam (
        idBr                 numeric(10,0) NOT NULL,
        idBrDam              numeric(10,0) NOT NULL,
        damUp                numeric(1,0) NULL,
        clsDam               numeric(10,0) NULL,
        clsDamTyp            numeric(10,0) NULL,
        damDn                numeric(1,0) NULL,
        damWidth             numeric(5,2) NULL,
        damRight             numeric(1,0) NULL,
        damHWL               numeric(5,2) NULL,
        numCross             numeric(10,0) NULL,
        clsRivSl             numeric(10,0) NULL,
        clsFldSl             numeric(10,0) NULL,
        rivSlope             numeric(10,0) NULL,
        fldSlope             numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrDam
        ADD PRIMARY KEY (idBrDam, idBr)
go
 
 
 CREATE TABLE ClsPrNoz (
        clsPrNoz             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsPrNoz
        ADD PRIMARY KEY (clsPrNoz)
go
 
 
 CREATE TABLE ClsPrBase (
        clsPrBase            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsPrBase
        ADD PRIMARY KEY (clsPrBase)
go
 
 
 CREATE TABLE ClsPier (
        clsPier              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsPier
        ADD PRIMARY KEY (clsPier)
go
 
 
 CREATE TABLE BrPier (
        idBr                 numeric(10,0) NOT NULL,
        idBrPier             numeric(10,0) NOT NULL,
        pierBeg              numeric(10,0) NULL,
        pierEnd              numeric(10,0) NULL,
        extPier              numeric(1,0) NULL,
        clsPier              numeric(10,0) NULL,
        clsPrMat             numeric(10,0) NULL,
        prHeight             numeric(5,2) NULL,
        baseCount            numeric(10,0) NULL,
        clsPrBase            numeric(10,0) NULL,
        baseDepth            numeric(5,2) NULL,
        pileCount            numeric(10,0) NULL,
        pileProf             nvarchar(20) NULL,
        clsPrNoz             numeric(10,0) NULL,
        poleCount            numeric(10,0) NULL,
        poleProf             nvarchar(20) NULL,
        nozLength            numeric(5,2) NULL,
        nozWidth             numeric(5,2) NULL,
        postCount            numeric(10,0) NULL,
        nozHeight            numeric(5,2) NULL,
        postProf             nvarchar(20) NULL,
        caseProf             nvarchar(20) NULL,
        nozCount             numeric(10,0) NULL,
        pierGeom             nvarchar(50) NULL,
        stdDesign            nvarchar(40) NULL,
        Notes                nvarchar(1000) NULL,
        blckCount            numeric(10,0) NULL,
        padCount             numeric(10,0) NULL,
        grillPres            numeric(1,0) NULL,
        grillEach            numeric(1,0) NULL,
        capRow               numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE BrPier
        ADD PRIMARY KEY (idBrPier, idBr)
go
 
 
 CREATE TABLE ClsBear (
        clsBear              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBear
        ADD PRIMARY KEY (clsBear)
go
 
 
 CREATE TABLE ClsBPos (
        clsBPos              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsBPos
        ADD PRIMARY KEY (clsBPos)
go
 
 
 CREATE TABLE BrBear (
        idBr                 numeric(10,0) NOT NULL,
        idBrBear             numeric(10,0) NOT NULL,
        clsBPos              numeric(10,0) NULL,
        numSpan              numeric(10,0) NULL,
        numPier              numeric(10,0) NULL,
        clsBear              numeric(10,0) NULL,
        beamEach             numeric(1,0) NULL,
        bearProf             nvarchar(20) NULL,
        beamBeg              numeric(10,0) NULL,
        beamEnd              numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL,
        movBear              numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE BrBear
        ADD PRIMARY KEY (idBrBear, idBr)
go
 
 
 CREATE TABLE ClsStrap (
        clsStrap             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsStrap
        ADD PRIMARY KEY (clsStrap)
go
 
 
 CREATE TABLE ClsCom (
        clsCom               numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsCom
        ADD PRIMARY KEY (clsCom)
go
 
 
 CREATE TABLE BrCom (
        idBr                 numeric(10,0) NOT NULL,
        idBrCom              numeric(10,0) NOT NULL,
        clsCom               numeric(10,0) NULL,
        clsStrap             numeric(10,0) NULL,
        comOwner             nvarchar(60) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrCom
        ADD PRIMARY KEY (idBrCom, idBr)
go
 
 
 CREATE TABLE ClsSigLoc (
        clsSigLoc            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsSigLoc
        ADD PRIMARY KEY (clsSigLoc)
go
 
 
 CREATE TABLE ClsSign (
        clsSign              numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsSign
        ADD PRIMARY KEY (clsSign)
go
 
 
 CREATE TABLE BrSign (
        idBr                 numeric(10,0) NOT NULL,
        idBrSign             numeric(10,0) NOT NULL,
        clsSign              numeric(10,0) NULL,
        clsSigLoc            numeric(10,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrSign
        ADD PRIMARY KEY (idBrSign, idBr)
go
 
 
 CREATE TABLE BrDef (
        idBr                 numeric(10,0) NOT NULL,
        idBrDef              numeric(10,0) NOT NULL,
        defCode              numeric(10,0) NULL,
        idBrElm              numeric(10,0) NULL,
        defOn                numeric(1,0) NULL,
        isHave               numeric(1,0) NULL,
        defScope             int NULL
 )
go
 
 
 ALTER TABLE BrDef
        ADD PRIMARY KEY (idBrDef, idBr)
go
 
 
 CREATE TABLE ViewBM (
        idView               numeric(10,0) NOT NULL,
        viewName             nvarchar(50) NULL,
        viewPer              numeric(10,0) NULL,
        privView             numeric(1,0) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE ViewBM
        ADD PRIMARY KEY (idView)
go
 
 
 CREATE TABLE ClsRiver (
        clsRiver             numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsRiver
        ADD PRIMARY KEY (clsRiver)
go
 
 
 CREATE TABLE ClsRivTyp (
        clsRivTyp            numeric(10,0) NOT NULL,
        clsText              nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE ClsRivTyp
        ADD PRIMARY KEY (clsRivTyp)
go
 
 
 CREATE TABLE BrRiverasd (
        idBr                 numeric(10,0) NOT NULL,
        idBrRiver            numeric(10,0) NOT NULL,
        clsRivTyp            numeric(10,0) NULL,
        clsRiver             numeric(10,0) NULL,
        navMeans             numeric(1,0) NULL,
        navPass              numeric(10,0) NULL,
        navDim               numeric(5,2) NULL,
        navRaft              numeric(1,0) NULL,
        rivHLCalc            numeric(5,2) NULL,
        rivHLExc             numeric(5,2) NULL,
        rivHLNav             numeric(5,2) NULL,
        iceHLCalc            numeric(5,2) NULL,
        iceShear             numeric(5,2) NULL,
        rivMdLW              numeric(5,2) NULL,
        rivDnLW              numeric(5,2) NULL,
        rivUpLW              numeric(5,2) NULL,
        rivWidth             numeric(5,2) NULL,
        chBlock              numeric(1,0) NULL,
        rivWHWL              numeric(5,2) NULL,
        frovDate             datetime NULL,
        driftDate            datetime NULL,
        floodDate            datetime NULL,
        iceBlock             numeric(1,0) NULL,
        iceThick             numeric(5,2) NULL,
        Notes                nvarchar(1000) NULL
 )
go
 
 
 ALTER TABLE BrRiverasd
        ADD PRIMARY KEY (idBrRiver, idBr)
go
 
 
 CREATE TABLE DefViewBM (
        idDefView            numeric(10,0) NOT NULL,
        defCode              numeric(10,0) NOT NULL,
        idView               numeric(10,0) NOT NULL
 )
go
 
 
 ALTER TABLE DefViewBM
        ADD PRIMARY KEY (idDefView)
go
 
 
 CREATE TABLE BrElm (
        idBr                 numeric(10,0) NOT NULL,
        ownldElm             numeric(10,0) NULL,
        idBrElm              numeric(10,0) NOT NULL,
        elmCode              numeric(10,0) NULL,
        elmNum               numeric(10,0) NULL,
        grdCur               numeric(5,2) NULL,
        elmClass             numeric(10,0) NULL,
        nameSuf              nvarchar(30) NULL,
        grdMin               numeric(5,2) NULL,
        grdEff1              numeric(5,2) NULL,
        isHave               numeric(1,0) NULL,
        grdEff2              numeric(5,2) NULL,
        minEff1              numeric(5,2) NULL,
        minEff2              numeric(5,2) NULL
 )
go
 
 
 ALTER TABLE BrElm
        ADD PRIMARY KEY (idBrElm, idBr)
go
 
 
 CREATE TABLE MainParams (
        idVersion            numeric(10,0) NOT NULL,
        idGU                 numeric(10,0) NULL,
        bmMode               numeric(10,0) NULL,
        impDate              datetime NULL,
        expDate              datetime NULL,
        impstate             numeric(1,0) NULL,
        expstate             numeric(1,0) NULL
 )
go
 
 
 ALTER TABLE MainParams
        ADD PRIMARY KEY (idVersion)
go
 
 
 CREATE TABLE clsModes (
        clsModes             numeric(10,0) NOT NULL,
        cls_Text             nvarchar(150) NULL
 )
go
 
 
 ALTER TABLE clsModes
        ADD PRIMARY KEY (clsModes)
go
 
 
 CREATE TABLE logFile (
        idFile               numeric(10,0) NOT NULL,
        fileText             nvarchar(4000) NULL,
        RunDate              datetime NULL
 )
go
 
 
 ALTER TABLE logFile
        ADD PRIMARY KEY (idFile)
go
 
 
 CREATE TABLE TransferFields (
        idField              numeric(10,0) NOT NULL,
        idNum                numeric(10,0) NULL,
        fieldText            nvarchar(4000) NULL
 )
go
 
 
 ALTER TABLE TransferFields
        ADD PRIMARY KEY (idField)
go
 
 
 ALTER TABLE Org
        ADD FOREIGN KEY (idUpr)
                              REFERENCES Org
go
 
 
 ALTER TABLE BrOrg
        ADD FOREIGN KEY (idOrg)
                              REFERENCES Org
go
 
 
 ALTER TABLE BrOrg
        ADD FOREIGN KEY (idMaster)
                              REFERENCES BrOrg
go
 
 
 ALTER TABLE Br
        ADD FOREIGN KEY (idBrOrg)
                              REFERENCES BrOrg
go
 
 
 ALTER TABLE BrBeam
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE ElmBM
        ADD FOREIGN KEY (ownElm)
                              REFERENCES ElmBM
go
 
 
 ALTER TABLE DefBM
        ADD FOREIGN KEY (idDefKind)
                              REFERENCES DefKindBM
go
 
 
 ALTER TABLE DefElmBM
        ADD FOREIGN KEY (elmCode)
                              REFERENCES ElmBM
go
 
 
 ALTER TABLE DefElmBM
        ADD FOREIGN KEY (defCode)
                              REFERENCES DefBM
go
 
 
 ALTER TABLE BrGen
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrLimit
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrVisit
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrDeck
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrOver
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrAppr
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrOvRd
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrOvRw
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrDam
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrPier
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrBear
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrCom
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrSign
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrDef
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE BrRiverasd
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 
 ALTER TABLE DefViewBM
        ADD FOREIGN KEY (idView)
                              REFERENCES ViewBM
go
 
 
 ALTER TABLE DefViewBM
        ADD FOREIGN KEY (defCode)
                              REFERENCES DefBM
go
 
 
 ALTER TABLE BrElm
        ADD FOREIGN KEY (idBr)
                              REFERENCES Br
go
 
 